<template>
    <div>
        <div class="header" style="background-color: white">
            <el-page-header @back="goBack" content="建议投诉">
            </el-page-header>
        </div>
        <el-divider></el-divider>
        <el-form :inline="true" :model="AdmComplain" class="demo-form-inline">
            <el-form-item label="客户名称：">
                <el-input v-model="AdmComplain.client" placeholder="客户名称"></el-input>
            </el-form-item>
            <el-form-item label="时间：">

                <el-col :span="11">
                    <el-input type="date" placeholder="选择日期" v-model="AdmComplain.complainSubmitTime"></el-input>
                </el-col>
                <el-col class="line" :span="2">-</el-col>
                <el-col :span="11">
                    <el-input type="date" placeholder="选择日期" v-model="AdmComplain.tel"></el-input>
                </el-col>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="GetAdmSigninrecos">查询</el-button>
            </el-form-item>
        </el-form>
        <el-table :data="AdmComplains.slice((currentPage-1)*pagesize,currentPage*pagesize)" height="500" border style="width: 100%">
            <el-table-column label="提交内容" prop="complainContent"></el-table-column>
            <el-table-column label="案件" prop="caseno"></el-table-column>
            <el-table-column label="客户名称" prop="client"> </el-table-column>
            <el-table-column label="联系电话" prop="tel"> </el-table-column>
            <el-table-column label="提交时间" prop="complainSubmitTime"></el-table-column>
            <el-table-column label="回复值" prop="complainReplyNumber"></el-table-column>
        </el-table>
        <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[5, 10, 20, 40]"
                :page-size="pagesize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="AdmComplains.length">
        </el-pagination>
    </div>
</template>

<script>
    import admcom from "../../../model/gsl/AdmComplains/admcomplain";
    const admco=admcom.getInstance();
    export default{
        components:{},
        data() {
            return {
                currentPage:1, //初始页
                pagesize:10,    //    每页的数
                AdmComplains:[],
                AdmComplain:{}
            };
        },
        created(){
            this.GetAdmSigninrecos();

        },
        methods: {
            // 初始页currentPage、初始每页数据数pagesize和数据data
            handleSizeChange: function (size) {
                this.pagesize = size;
                console.log(this.pagesize)  //每页下拉显示数据
            },
            handleCurrentChange: function(currentPage){
                this.currentPage = currentPage;
                console.log(this.currentPage)  //点击第几页
            },
            GetAdmSigninrecos(){
                admco.list(this.AdmComplain).then((re)=>{
                    this.AdmComplains=re.data.data;
                    this.AdmComplain={}
                })
            },
            goBack(){
                history.back()
            }
        }
    }
</script>
